﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;

//通用Tilemap数据
[CreateAssetMenu]
public class TilemapData : ScriptableObject
{
    [SerializeField]
    private List<TileBase> tiles_platform;
    [SerializeField]
    //必须与tiles_platform一一对应
    private List<TileBase> tiles_light;

    public Tile tile_test;

    /// <summary>
    /// 通过已有的platform tile获取对应的light tile
    /// </summary>
    public void GetTiles(List<TileBase> output, List<TileBase> input)
    {
        for (int i = 0; i < input.Count; i++)
        {
            for (int j = 0; j < tiles_platform.Count; j++)
            {
                if (input[i] == tiles_platform[j])
                {
                    output.Add(tiles_light[j]);
                    break;
                }
            }
        }
    }
}
